home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Sort.sig < prev    next >
Encoding:
Text File  |  1997-08-18  |  680 b   |  13 lines  |  [TEXT/R*ch]

  1. (* Sorting and merging lists *)
  2.  
  3. val sort : ('a -> 'a -> bool) -> 'a list -> 'a list;
  4.         (* Sort a list in increasing order according to an ordering predicate.
  5.            The predicate should return [true] if its first argument is
  6.            less than or equal to its second argument. *)
  7. val merge : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list;
  8.         (* Merge two lists according to the given predicate.
  9.            Assuming the two argument lists are sorted according to the
  10.            predicate, [merge] returns a sorted list containing the elements
  11.            from the two lists. The behavior is undefined if the two
  12.            argument lists were not sorted. *)
  13.